
#ifndef Utils_H
#define Utils_H
#include "RoosterBase.h"

static const uint16_t BitsMask[16] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000};

#define mBitT( word, bit ) (((word) & BitsMask[bit])!=0)
#define mBitS( word, bit ) ((word) |= BitsMask[bit])     //Bit Set
#define mBitR( word, bit ) ((word) &= ~BitsMask[bit])    //Bit clear
#define mBitV( word, bit, v ) ((v)?BitS(word,bit):BitR(byte,bit))

int bcdToDecimal(int bcd);

#endif
